<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="title">
        DataTable - <span class="subitem">SummaryRow</span>
    </ui:define>

    <ui:define name="description">
        SummaryRow is a helper component of datatable used for dynamic grouping.
    </ui:define>

    <ui:param name="documentationLink" value="/components/datatable" />

    <ui:define name="implementation">
        
        <h:form>
            <p:dataTable var="car" value="#{dtSummaryRowView.cars}" sortBy="#{car.brand}">
                <p:column headerText="Id" sortBy="#{car.id}">
                    <h:outputText value="#{car.id}" />
                </p:column>
                <p:column headerText="Year" sortBy="#{car.year}">
                    <h:outputText value="#{car.year}" />
                </p:column>
                <p:column headerText="Brand" sortBy="#{car.brand}">
                    <h:outputText value="#{car.brand}" />
                </p:column>
                <p:column headerText="Color" sortBy="#{car.color}">
                    <h:outputText value="#{car.color}" />
                </p:column>
                <p:summaryRow>
                    <p:column colspan="3" style="text-align:right">
                        <h:outputText value="Total:" />
                    </p:column>
                    <p:column>
                        <h:outputText value="#{dtSummaryRowView.randomPrice}">
                            <f:convertNumber type="currency" currencySymbol="$" />
                        </h:outputText>
                    </p:column>
                </p:summaryRow>
            </p:dataTable>
        </h:form>
        
    </ui:define>

</ui:composition>